import type { PlayList, Subcount } from '~/types/songs';

/* 用户的仓库 */
const useSongsStore = defineStore('songs', {
  persist: {
    storage: persistedState.localStorage
  },
  state: () => {
    return {
      songsNumber: {} as const as Subcount,
      songsList: {} as const as PlayList[]
    };
  },
  actions: {
    setSongs(data: Subcount) {
      this.songsNumber = data;
    },
    setSongsList(data: PlayList[]) {
      this.songsList = data;
    }
  }
});

export default useSongsStore;
